<!--
 * @FileDescription 工单
 * @Author lz
 * @Date 20230526 15:05:37
 * @LastEditors lz
 * @LastEditTime 20230526 15:05:37
-->
<template>
  <div>
    <a-modal
      visible
      title="选手报告单"
      :maskClosable="false"
      @cancel="handleOk"
      class="antModal"
    >
      <template #footer>
        <div class="paging">
          <span class="arrow" @click="L"></span>
          <span class="ArrContent"
            ><a-pagination
              v-model:current="HomeContent.Default.PlayerReportData.value.Id"
              :total="HomeContent.Default.PlayerReportData.value.Count * 10"
              show-less-items
              @change="changes"
          /></span>
          <span class="arrowTwo" @click="R"></span>
        </div>

        <a-button key="back" @click="DeleWorkOrder" class="del_btn">删除当前页</a-button>
        <a-button key="submit" @click="AddWorkOrder" class="add_btn"
          ><img src="/images/ic_add.png" class="ic_add" />添加工单</a-button
        >
      </template>
      <div class="contentBox">
        <div class="title_box">
          选手报告单
          <img
            src="/images/ic_up_small.png"
            class="retract_img"
            @click="retract"
            v-if="state.retract"
          />
          <img
            src="/images/ic_down_small.png"
            class="retract_img"
            @click="retract"
            v-else
          />
        </div>
        <div class="BasicInformation" v-show="state.retract">
          <div class="Basi_unit BOR BN">
            <span class="unit_tit">选手参赛号</span>
            <div class="unit_inp">{{ BasicData.Id || "" }}</div>
          </div>
          <div class="Basi_unit BOR">
            <span class="unit_tit">裁判签字</span>
          </div>
          <div class="Basi_unit BOR">
            <span class="unit_tit">裁判长审判</span>
          </div>
          <div class="Basi_unit BOR BN">
            <span class="unit_tit">统分裁判签字</span>
          </div>
          <div class="Basi_unit BOR">
            <span class="unit_tit">裁判签字</span>
          </div>
          <div class="Basi_unit BOR">
            <span class="unit_tit">监督仲裁签字</span>
          </div>
          <div class="Basi_unit BOR BN">
            <span class="unit_tit">车辆信息登记</span>
            <input
              type="text"
              v-model="BasicData.CarId"
              @blur="inputonblur"
              class="unit_inp"
            />
          </div>
          <div class="Basi_unit BOR">
            <span class="unit_tit">比赛时长</span>
            <div class="unit_inp">
              {{ formatSeconds(BasicData.Time) }}
            </div>
          </div>
          <div class="Basi_unit BOR">
            <span class="unit_tit">实际用时</span>
            <div class="unit_inp">{{ formatSeconds(BasicData.UseTime) }}</div>
          </div>
        </div>

        <div class="Form_box">
          <div class="tit_box">
            <div class="form_tit BOR rep_T1 BN">项目</div>
            <div class="form_tit BOR rep_T2">内容</div>
            <div class="form_tit BOR rep_T3">配分</div>
            <div class="form_tit BOR rep_T4">得分</div>
          </div>
          <div class="form_content">
            <div class="form_content_unit">
              <div class="form_content_unit_tit rep_T1 BOR BN">
                <span class="content_unit_tit"> 故障现象描述 </span>
              </div>
              <div class="unit_list_box rep_T2">
                <div
                  class="form_content_unit_list BOR"
                  :key="index"
                  v-for="(item, index) in HomeContent.Default.PlayerReportData.value
                    .Appearences.Contents"
                >
                  <a-popconfirm
                    title="是否删除？"
                    ok-text="是"
                    cancel-text="否"
                    @confirm="deletelist(item.Id, 1)"
                    @cancel="cancel"
                  >
                    <img src="/images/bt_reduce.png" class="Add_ico" />
                  </a-popconfirm>
                  <div class="addTxt Existing">{{ item.Description }}</div>
                </div>
                <div class="form_content_unit_list BOR">
                  <img src="/images/bt_add.png" class="Add_ico" @click="SubmenuCel(1)" />
                  <span class="addTxt">去添加</span>
                </div>
              </div>
              <div class="rep_partition rep_T3 BOR">
                <span class="rep_parameter">{{
                  HomeContent.Default.PlayerReportData.value.Appearences.Distribution
                }}</span>
              </div>
              <div class="rep_score rep_T4 BOR">
                <span class="rep_parameter">{{
                  HomeContent.Default.PlayerReportData.value.Appearences.Score
                }}</span>
              </div>
            </div>
            <div class="form_content_unit">
              <div class="form_content_unit_tit rep_T1 BOR BN">
                <span class="content_unit_tit"> 通过分析得出故障可能原因 </span>
              </div>
              <div class="unit_list_box rep_T2">
                <div
                  class="form_content_unit_list BOR"
                  :key="index"
                  v-for="(item, index) in HomeContent.Default.PlayerReportData.value
                    .Reasons.Contents"
                >
                  <a-popconfirm
                    title="是否删除？"
                    ok-text="是"
                    cancel-text="否"
                    @confirm="deletelist(item.Id, 2)"
                    @cancel="cancel"
                  >
                    <img src="/images/bt_reduce.png" class="Add_ico" />
                  </a-popconfirm>
                  <div class="addTxt Existing">{{ item.Description }}</div>
                </div>
                <div class="form_content_unit_list BOR">
                  <img src="/images/bt_add.png" class="Add_ico" @click="SubmenuCel(2)" />
                  <span class="addTxt">去添加</span>
                </div>
              </div>
              <div class="rep_partition rep_T3 BOR">
                <span class="rep_parameter">{{
                  HomeContent.Default.PlayerReportData.value.Reasons.Distribution
                }}</span>
              </div>
              <div class="rep_score rep_T4 BOR">
                <span class="rep_parameter">{{
                  HomeContent.Default.PlayerReportData.value.Reasons.Score
                }}</span>
              </div>
            </div>
            <div class="form_content_unit">
              <div class="form_content_unit_tit rep_T1 BOR BN">
                <span class="content_unit_tit"> 故障检修过程 </span>
              </div>
              <div class="unit_list_box rep_T2">
                <div
                  class="form_content_unit_list BOR"
                  :key="index"
                  v-for="(item, index) in HomeContent.Default.PlayerReportData.value
                    .Detectors.Contents"
                >
                  <a-popconfirm
                    title="是否删除？"
                    ok-text="是"
                    cancel-text="否"
                    @confirm="deletelist(item.Id, 3)"
                    @cancel="cancel"
                  >
                    <img src="/images/bt_reduce.png" class="Add_ico" />
                  </a-popconfirm>
                  <a-tooltip>
                    <template #title>{{ item.Description }}</template>
                    <div class="addTxt Existing">{{ item.Description }}</div>
                  </a-tooltip>
                </div>
                <div class="form_content_unit_list BOR">
                  <img src="/images/bt_add.png" class="Add_ico" @click="SubmenuCel(3)" />
                  <span class="addTxt">去添加</span>
                </div>
              </div>
              <div class="rep_partition rep_T3 BOR">
                <span class="rep_parameter">{{
                  HomeContent.Default.PlayerReportData.value.Detectors.Distribution
                }}</span>
              </div>
              <div class="rep_score rep_T4 BOR">
                <span class="rep_parameter">{{
                  HomeContent.Default.PlayerReportData.value.Detectors.Score
                }}</span>
              </div>
            </div>
            <div class="form_content_unit">
              <div class="form_content_unit_tit rep_T1 BOR BN">
                <span class="content_unit_tit"> 故障点和故障类型确认 </span>
              </div>
              <div class="unit_list_box rep_T2">
                <div
                  class="form_content_unit_list BOR"
                  :key="index"
                  v-for="(item, index) in HomeContent.Default.PlayerReportData.value
                    .Faults.Contents"
                >
                  <a-popconfirm
                    title="是否删除？"
                    ok-text="是"
                    cancel-text="否"
                    @confirm="deletelist(item.Id, 4)"
                    @cancel="cancel"
                  >
                    <img src="/images/bt_reduce.png" class="Add_ico" />
                  </a-popconfirm>
                  <div class="addTxt Existing">{{ item.Description }}</div>
                </div>
                <div class="form_content_unit_list BOR">
                  <img src="/images/bt_add.png" class="Add_ico" @click="SubmenuCel(4)" />
                  <span class="addTxt">去添加</span>
                </div>
              </div>
              <div class="rep_partition rep_T3 BOR">
                <span class="rep_parameter">{{
                  HomeContent.Default.PlayerReportData.value.Faults.Distribution
                }}</span>
              </div>
              <div class="rep_score rep_T4 BOR">
                <span class="rep_parameter">{{
                  HomeContent.Default.PlayerReportData.value.Faults.Score
                }}</span>
              </div>
            </div>
            <div class="form_content_unit">
              <div class="form_content_unit_tit rep_T1 BOR BN">
                <span class="content_unit_tit"> 故障机理分析 </span>
              </div>
              <div class="unit_list_box rep_T2">
                <div
                  class="form_content_unit_list BOR"
                  :key="index"
                  v-for="(item, index) in HomeContent.Default.PlayerReportData.value
                    .Theorys.Contents"
                >
                  <a-popconfirm
                    title="是否删除？"
                    ok-text="是"
                    cancel-text="否"
                    @confirm="deletelist(item.Id, 5)"
                    @cancel="cancel"
                  >
                    <img src="/images/bt_reduce.png" class="Add_ico" />
                  </a-popconfirm>
                  <div class="addTxt Existing">{{ item.Description }}</div>
                </div>
                <div class="form_content_unit_list BOR">
                  <img src="/images/bt_add.png" class="Add_ico" @click="SubmenuCel(5)" />
                  <span class="addTxt">去添加</span>
                </div>
              </div>
              <div class="rep_partition rep_T3 BOR">
                <span class="rep_parameter">{{
                  HomeContent.Default.PlayerReportData.value.Theorys.Distribution
                }}</span>
              </div>
              <div class="rep_score rep_T4 BOR">
                <span class="rep_parameter">{{
                  HomeContent.Default.PlayerReportData.value.Theorys.Score
                }}</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </a-modal>
    <div class="OptionsMenu" v-if="state.visible && state.ListTypes == 3">
      <div class="op_cont2">
        <div class="op_hdr">
          {{ FBT }}
          <close-outlined class="close_ico2" @click="op_close" />
        </div>
        <div class="li_box">
          <a-textarea
            v-model:value="FaultContent"
            placeholder=""
            :rows="4"
            show-count
            :maxlength="200"
          />
        </div>
        <div class="footer_box">
          <div class="determine" @click="Add">
            <img src="/images/ic_48.png" />
            保存
          </div>
        </div>
      </div>
    </div>
    <div class="OptionsMenu" v-if="state.visible && state.ListTypes != 3">
      <div class="op_cont">
        <div class="op_hdr">
          选择故障现象
          <close-outlined class="close_ico" @click="op_close" />
        </div>
        <div class="inp_box">
          <search-outlined class="search_ico" @click="searchBtn" />
          <input
            type="text"
            class="search"
            v-model="sea_inp"
            @keyup.enter.native="searchBtn"
          />
          <a-button class="resetting" @click="resetBtn">重置</a-button>
        </div>
        <div class="optionList">
          <div class="li_box_cont">
            <a-checkbox-group v-model:value="state.values" style="width: 100%">
              <a-row>
                <a-col
                  :span="24"
                  v-for="(item, index) in HomeContent.Default.WorkOrderAddItem.value"
                  :key="index"
                >
                  <a-checkbox :value="item.Id">{{ item.Description }}</a-checkbox>
                </a-col>
              </a-row>
            </a-checkbox-group>
          </div>
        </div>
        <a-button class="dete" type="primary" @click="ConfirmAdd">确定</a-button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ClientMessage } from "@runtime/generate/message/ClientMessage";
import WebSocketComponent from "@runtime/module/WebSocket/WebSocketComponent";
import {
  reactive,
  ref,
  toRefs,
  onBeforeMount,
  onMounted,
  onBeforeUpdate,
  onUpdated,
  onUnmounted,
} from "vue";
import HomeContent from "../HomeContent";
import { CloseOutlined, SearchOutlined } from "@ant-design/icons-vue";
import MessageCode from "../MessageCode";
const sea_inp = ref<string>("");
const FBT = ref<string>("");
const FaultContent = ref<string>("");
let BasicData = ref<any>({
  CarId: "",
  Id: "",
  Time: "",
  UseTime: "",
});
const state = reactive({
  retract: true,
  current: 2,
  visible: false,
  ListTypes: 0,
  values: <any>[],
});
function SubmenuOk() {
  state.visible = false;
}
function cancel() {}
//搜索
async function searchBtn() {
  if (state.ListTypes == 1) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_GET_APPEARENCE
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.WorkOrderAddItem.value = JSON.parse(newArr.Content).Result;
  } else if (state.ListTypes == 2) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_GET_REASON
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.WorkOrderAddItem.value = JSON.parse(newArr.Content).Result;
  } else if (state.ListTypes == 4) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_GET_FAULT
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.WorkOrderAddItem.value = JSON.parse(newArr.Content).Result;
  } else if (state.ListTypes == 5) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_GET_THEORY
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.WorkOrderAddItem.value = JSON.parse(newArr.Content).Result;
  }
  if (sea_inp.value != "") {
    let data = [];
    for (let i = 0; i < HomeContent.Default.WorkOrderAddItem.value.length; i++) {
      if (
        HomeContent.Default.WorkOrderAddItem.value[i].Description.indexOf(
          sea_inp.value
        ) != -1
      ) {
        data.push(HomeContent.Default.WorkOrderAddItem.value[i]);
      }
    }
    HomeContent.Default.WorkOrderAddItem.value = [];
    data.forEach((item) => {
      HomeContent.Default.WorkOrderAddItem.value.push(item);
    });
  }
}
//秒数转化为时分秒
function formatSeconds(value: any) {
  if (value == null) {
    return "";
  }
  //@ts-ignore
  let secondTime = parseInt(value); // 秒
  let minuteTime = 0; // 分
  let hourTime = 0; // 小时
  if (secondTime > 60) {
    //如果秒数大于60，将秒数转换成整数
    //获取分钟，除以60取整数，得到整数分钟
    //@ts-ignore
    minuteTime = parseInt(secondTime / 60);
    //获取秒数，秒数取余，得到整数秒数
    //@ts-ignore
    secondTime = parseInt(secondTime % 60);
    //如果分钟大于60，将分钟转换成小时
    if (minuteTime > 60) {
      //获取小时，获取分钟除以60，得到整数小时
      //@ts-ignore
      hourTime = parseInt(minuteTime / 60);
      //获取小时后取余的分，获取分钟除以60取余的分
      //@ts-ignore
      minuteTime = parseInt(minuteTime % 60);
    }
  }
  //@ts-ignore
  var result = "" + parseInt(secondTime) + "秒";

  if (minuteTime > 0) {
    //@ts-ignore
    result = "" + parseInt(minuteTime) + "分" + result;
  }
  if (hourTime > 0) {
    //@ts-ignore
    result = "" + parseInt(hourTime) + "小时" + result;
  }
  console.log("result", result);
  return result;
}
//添加
async function Add() {
  let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
    new ClientMessage.DiagnosisAdapterRequest(
      MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_ADD_DETECTOR,
      `${FaultContent.value.toString()}`
    )
  );
  console.log(JSON.parse(newArr.Content).Result);
  HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  FaultContent.value = "";
  state.visible = false;
}
//添加列表
async function AddList() {
  if (state.ListTypes == 1) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_ADD_APPEARENCE,
        `${state.values.toString()}`
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  } else if (state.ListTypes == 2) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_ADD_REASON,
        `${state.values.toString()}`
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  } else if (state.ListTypes == 4) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_ADD_FAULT,
        `${state.values.toString()}`
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  } else if (state.ListTypes == 5) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_ADD_THEORY,
        `${state.values.toString()}`
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  }
}
//删除故障
async function deletelist(val: number, index: number) {
  if (index == 1) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_DELETE_APPEARENCE,
        `${val}`
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  } else if (index == 2) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_DELETE_REASON,
        `${val}`
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  } else if (index == 3) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_DELETE_DETECTOR,
        `${val}`
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  } else if (index == 4) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_DELETE_FAULT,
        `${val}`
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  } else if (index == 5) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_DELETE_THEORY,
        `${val}`
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  }
}
//添加故障
async function SubmenuCel(val: number) {
  state.ListTypes = val;
  if (val == 1) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_GET_APPEARENCE
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.WorkOrderAddItem.value = JSON.parse(newArr.Content).Result;
  } else if (val == 2) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_GET_REASON
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.WorkOrderAddItem.value = JSON.parse(newArr.Content).Result;
  } else if (val == 3) {
    FBT.value = "故障检修过程";
  } else if (val == 4) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_GET_FAULT
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.WorkOrderAddItem.value = JSON.parse(newArr.Content).Result;
  } else if (val == 5) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_GET_THEORY
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.WorkOrderAddItem.value = JSON.parse(newArr.Content).Result;
  }

  state.visible = true;
}
const handleOk = async () => {
  await WebSocketComponent.Default.PostMessageAsync(
    new ClientMessage.DiagnosisAdapterRequest(
      MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_UPDATE_BASE_CONFIG,
      JSON.stringify(BasicData.value)
    )
  );
  let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
    new ClientMessage.DiagnosisAdapterRequest(
      MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_CLOSE
    )
  );
  HomeContent.Default.ModuleShow.value = false;
};
async function inputonblur() {
  await WebSocketComponent.Default.PostMessageAsync(
    new ClientMessage.DiagnosisAdapterRequest(
      MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_UPDATE_BASE_CONFIG,
      JSON.stringify(BasicData.value)
    )
  );
}
//重置
function resetBtn() {
  sea_inp.value = "";
  state.values = [];
  searchBtn();
}
//添加故障现象
function ConfirmAdd() {
  if (state.ListTypes == 4) {
    if (state.values.length > 0) {
      AddList();
      sea_inp.value = "";
      state.values = [];
      FaultContent.value = "";
      state.visible = false;
    }
  }
}
function op_close() {
  sea_inp.value = "";
  if (state.values.length > 0) {
    // AddList()
  }
  state.values = [];
  FaultContent.value = "";
  state.visible = false;
}
//添加工单
async function AddWorkOrder() {
  let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
    new ClientMessage.DiagnosisAdapterRequest(
      MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_ADD_PAGE
    )
  );
  console.log(JSON.parse(newArr.Content).Result);
  HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
}
//删除工单
async function DeleWorkOrder() {
  let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
    new ClientMessage.DiagnosisAdapterRequest(
      MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_DELETE_PAGE
    )
  );
  console.log(JSON.parse(newArr.Content).Result);
  HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
}
//分页跳转
async function changes(v1: any, v2: any) {
  console.log(v1);
  let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
    new ClientMessage.DiagnosisAdapterRequest(
      MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_GOTO_PAGE,
      `${v1}`
    )
  );
  console.log(JSON.parse(newArr.Content).Result);
  HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
}
//收起
function retract() {
  state.retract = !state.retract;
}
async function L() {
  if (HomeContent.Default.PlayerReportData.value.Id > 1) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_PREV_PAGE
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  }
}
async function R() {
  if (
    HomeContent.Default.PlayerReportData.value.Id <
    HomeContent.Default.PlayerReportData.value.Count
  ) {
    let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
      new ClientMessage.DiagnosisAdapterRequest(
        MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_NEXT_PAGE
      )
    );
    console.log(JSON.parse(newArr.Content).Result);
    HomeContent.Default.PlayerReportData.value = JSON.parse(newArr.Content).Result;
  }
}
onMounted(async () => {
  // let newArr: any = await WebSocketComponent.Default.PostMessageAsync(new ClientMessage.DiagnosisAdapterRequest(MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_GET))
  // console.log(JSON.parse(newArr.Content).Result);
  let newArr: any = await WebSocketComponent.Default.PostMessageAsync(
    new ClientMessage.DiagnosisAdapterRequest(
      MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_GET_BASE_CONFIG
    )
  );
  console.log(JSON.parse(newArr.Content).Result);
  BasicData.value = JSON.parse(newArr.Content).Result;
  if (HomeContent.Default.BDT.value == "0") {
  } else {
    (BasicData.value.Id = HomeContent.Default.CacheFullData.value.ResultId),
      (BasicData.value.Time = HomeContent.Default.CacheFullData.value.Duration);
  }

  await WebSocketComponent.Default.PostMessageAsync(
    new ClientMessage.DiagnosisAdapterRequest(
      MessageCode.Default.MsgCodesList.DIAGNOSTIC_ORDER_UPDATE_BASE_CONFIG,
      JSON.stringify(BasicData.value)
    )
  );
});
</script>

<style scoped>
.paging {
  position: absolute;
  left: 24px;
  bottom: 24px;
  text-align: center;
}

.arrow {
  float: left;
  width: 36px;
  height: 36px;
  background-image: url("/images/ic_prev_disable.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.arrow:hover {
  background-image: url("/images/ic_prev.png");
}

.ArrContent {
  float: left;
  margin-top: 2px;
  margin-left: 20px;
  margin-right: 10px;
  text-align: center;
  max-width: 320px;
}

.arrowTwo {
  float: left;
  width: 36px;
  height: 36px;
  background-image: url("/images/ic_next_disable.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.arrowTwo:hover {
  background-image: url("/images/ic_next.png");
}

.del_btn {
  width: 128px;
  height: 48px;
  background: #ffffff;
  border-radius: 6px 6px 6px 6px;
  border: 1px solid #e9e9e9;
  margin-top: 14px !important;
}

.add_btn {
  width: 140px;
  height: 48px;
  background: #9bfb4e;
  border-radius: 6px 6px 6px 6px;
  margin-left: 20px !important;
}

.ic_add {
  width: 24px;
  left: 24px;
  margin-top: -2px;
}

.contentBox {
  border: 1px solid #e8ecf4;
  width: 100%;
  border-radius: 10px 10px 0 0;
}

.title_box {
  height: 62px;
  line-height: 62px;
  font-size: 20px;
  font-weight: 600;
  padding-left: 10px;
}

.retract_img {
  float: right;
  width: 24px;
  margin-top: 16px;
  margin-right: 16px;
}

.BasicInformation {
  width: 100%;
  height: 168px;
}

.Basi_unit {
  float: left;
  width: 33.333%;
  height: 56px;
}

.BOR {
  border-top: 1px solid #e8ecf4;
  border-left: 1px solid #e8ecf4;
}

.BN {
  border-left: none;
}

.unit_tit {
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 56px;
  padding-left: 16px;
  font-weight: 600;
}

.unit_inp {
  width: 300px;
  height: 56px;
  outline: none;
  font-size: 16px;
  border: none;
  float: right;
  margin-right: 16px;
  line-height: 56px;
}

.Form_box {
  width: 100%;
}

.tit_box {
  width: 100%;
  height: 42px;
  background-color: #f7f8fb;
}

.form_tit {
  float: left;
  text-align: center;
  line-height: 42px;
  font-size: 14px;
  font-weight: 600;
}

.rep_T1 {
  width: 26%;
}

.rep_T2 {
  width: 54%;
}

.rep_T3 {
  width: 10%;
}

.rep_T4 {
  width: 10%;
}

.form_content_unit {
  width: 100%;
  min-height: 64px;
  position: relative;
  overflow: hidden;
}

.form_content_unit_tit {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.form_content_unit_list {
  width: 100%;
  float: left;
  height: 64px;
  line-height: 64px;
}

.rep_partition {
  position: absolute;
  top: 0;
  right: 10%;
  bottom: 0;
}

.rep_score {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
}

.content_unit_tit {
  font-size: 16px;
  font-weight: 400;
  color: #202020;
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translate(0, -50%);
}

.Add_ico {
  float: left;
  width: 36px;
  margin: 15px;
  margin-right: 10px;
  margin-top: 13px;
}

.addTxt {
  float: left;
  font-size: 16px;
  font-weight: 400;
  color: #b0b0b0;
}

.unit_list_box {
  float: left;
  margin-left: 26%;
}

.rep_parameter {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

:deep().ant-pagination-prev {
  display: none;
}

:deep().ant-pagination-next {
  display: none;
}

:deep().ant-pagination-options {
  display: none;
}

.OptionsMenu {
  width: 100%;
  height: 100%;
  background: rgba(6, 6, 21, 0.3);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.op_cont {
  width: 632px;
  height: 860px;
  background: #ffffff;
  border-radius: 16px 16px 16px 16px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.op_hdr {
  height: 108px;
  width: 100%;
  line-height: 100px;
  font-size: 24px;
  font-weight: 600;
  color: #202020;
  margin-left: 40px;
}

.close_ico {
  padding-left: 380px;
  line-height: 100px;
  font-size: 24px;
  font-weight: 600;
}

.inp_box {
  width: 100%;
  position: absolute;
  left: 0;
}

.search {
  width: 460px;
  height: 56px;
  background: #f8f8f8;
  border-radius: 12px 12px 12px 12px;
  border: none;
  outline: none;
  padding-left: 60px;
  margin-left: 40px;
  font-size: 18px;
}

.search_ico {
  position: absolute;
  left: 60px;
  top: 16px;
  font-size: 26px;
  color: rgba(176, 176, 176, 1);
}

.optionList {
  margin-top: 80px;
  height: 588px;
  width: 560px;
  margin-left: 40px;
  overflow-y: auto;
}

.optionList::-webkit-scrollbar {
  /*滚动条整体样式*/
  width: 6px;
  /*高宽分别对应横竖滚动条的尺寸*/
  height: 1px;
}

.optionList::-webkit-scrollbar-thumb {
  /*滚动条里面小方块*/

  border-radius: 10px;
  background: #dfe1e8;
}

.optionList::-webkit-scrollbar-track {
  /*滚动条里面轨道*/

  border-radius: 10px;
  background: #f8f8f8;
}

:deep().ant-col {
  width: 552px;
  height: 70px;
  border-bottom: 1px solid #f0f0f0;
}

.Existing {
  color: rgba(26, 26, 26, 1);
  width: 655px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:deep().ant-checkbox-wrapper {
  display: flex;
  align-items: center;
  height: 70px;
}

:deep().ant-checkbox {
  top: 0;
}

.op_cont2 {
  width: 632px;
  background: #ffffff;
  border-radius: 16px 16px 16px 16px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  padding-bottom: 60px;
}

.determine {
  position: absolute;
  right: 30px;
  bottom: 10px;
  width: 108px;
  height: 48px;
  background: #9bfb4e;
  font-size: 14px;
  line-height: 48px;
  text-align: center;
  border-radius: 6px;
}

.close_ico2 {
  padding-left: 370px;
  line-height: 100px;
  font-size: 24px;
  font-weight: 600;
}

.inp_box {
  width: 100%;
  position: absolute;
  left: 0;
}

.li_box {
  margin: 0 auto;
  width: 90%;
}

.dete {
  margin-left: 10px;
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 108px;
  height: 48px;
  background: #9bfb4e;
  border: none;
  color: #000;
  border-radius: 6px 6px 6px 6px;
}

.resetting {
  margin-left: 10px;
  border-radius: 4px;
  height: 50px;
}
</style>
